package com.liangzhong.model.goods.vo
{
	import com.global.GlobalDef;
	import com.liangzhong.model.type.GoodsType;

	/**
	 *属性卡 
	 * @author lake
	 * 
	 */	
	public class AttributeVo extends GoodsVo
	{
		/**
		 *属性卡ID 
		 */		
		public var attributeid 			:int;
		/**
		 *属性卡名字 
		 */		
		public var attrname 			:String;
		/**
		 *类型：
		1.	进攻属性卡
		2.	防守属性卡
		3.	抢断属性卡
		4.	力量属性卡
		5.	速度属性卡
		6.	控球属性卡 
		 */		
		//public var ntype				:int;
		/**
		 * 进攻（百分比加成）
		 */		
		public var attack 				:int;
		/**
		 * 防守（百分比加成）
		 */		
		public var defence 				:int;
		/**
		 * 抢断（百分比加成）
		 */	
		public var steal 				:int;
		/**
		 * 力量（百分比加成）
		 */	
		public var power 				:int;
		/**
		 * 速度（百分比加成）
		 */	
		public var speed 				:int;
		/**
		 * 控球（百分比加成）
		 */	
		public var control 				:int;
		
		public function AttributeVo()
		{
			super();
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		override public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
			name 	= attrname;
			url  	= GlobalDef.Web_Res_Url + "prop/" + header;
			type 	= GoodsType.ATTRIBUTE;
			pid 	= attributeid;
			gid		= attributeid;
		}
		/**
		 *获取 tip 信息 
		 * @return 
		 * 
		 */		
		public function get tips():String
		{
			var info :String = "<p align='left'>";
			var colorDesc :String = "<font color='#FF6666'>";
			if(attack != 0)
			{
				info += colorDesc;
				info += "进攻+" + attack + "%</font>\n";
			}
			if(defence != 0)
			{
				info += colorDesc;
				info += "防守+" + defence + "%</font>\n";
			}
			if(steal != 0)
			{
				info += colorDesc;
				info += "抢断+" + steal + "%</font>\n";
			}
			if(power != 0)
			{
				info += colorDesc;
				info += "力量+" + power + "%</font>\n";
			}
			if(speed != 0)
			{
				info += colorDesc;
				info += "速度+" + speed + "%</font>\n";
			}
			if(control != 0)
			{
				info += colorDesc;
				info += "控球+" + control + "%</font>\n";
			}
			info += "</p>";
			return info;
		}
		/**
		 *获取tips 显示信息 
		 * @return 
		 * 
		 */		
		override public function get tipsInfo():String
		{
			var info :String = super.tipsInfo;
			info += tips;
			info +="<p align='left'><font color='#33ccff'>在球员中心中为球员装备</font>";
			return info;
		}
	}
}